// 数据模型
class Category {
  final String name;
  final int id;
  final List<SubCategory>? subCategories;

  Category({
    required this.name, required this.id, this.subCategories
  });

  factory Category.fromJson(Map<String, dynamic> json) {
    return Category(
      id:json['id'],
      name: json['name'],
      subCategories:json['subCategories'],
    );
  }
}

class SubCategory {
  final String name;
  final String id;

  SubCategory({required this.name, required this.id});
}